import request from '@/utils/request'
//获取组织架构tree树形结构列表
export function getDepartment() {
    return request({
        url: '/department/getDepartmentList',
        method: 'get',
    })
}

//获取部门下拉负责人列表
export function getDepartmentLeader() {
    return request({
        url: '/department/getDepartmentLeader',
        method: 'get',
    })
}

// 新增组织
export function addDepartment(data) {
    return request({
        url: '/department/addDepartment',
        method: 'post',
        data
    })
}

// 获取部门详情
export function departmentFindById(deptId) {
    return request({
        url: '/department/findById',
        method: 'get',
        params: {
            deptId:deptId
        }
    })
}

// 跟新部门详情
export function updateDepartment(data) {
    return request({
        url: '/department/updateDepartment',
        method: 'put',
        data
    })
}

// 删除部门
export function deleteDepartment(deptId) {
    return request({
        url: `/department/deleteDeptId/${deptId}`,
        method: 'delete',
    })
}